package com.android.citynetworkpin.adapt;

import android.widget.ImageView;

import com.android.citynetworkpin.model.member.OrderRefoundData;
import com.android.citynetworkpin.R;
import com.android.citynetworkpin.utils.ObjectUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2016/8/10.
 */
public class listMinOrderRefundAdapt extends BaseQuickAdapter<OrderRefoundData.DataBean.ListBean, BaseViewHolder> {
    public listMinOrderRefundAdapt(int layoutResId, List<OrderRefoundData.DataBean.ListBean> data) {
        super(layoutResId, data);

    }



    @Override
    protected void convert(BaseViewHolder holder, OrderRefoundData.DataBean.ListBean listBean) {
        holder.setText(R.id.item_list_mine_dingdang_title, listBean.getGoods_name());
        holder.setText(R.id.shuliang, "数量：" + listBean.getBuy_num());
        holder.setText(R.id.item_list_mine_dingdang_zhuangtai, listBean.getStatus_name());
        holder.setText(R.id.item_list_mine_dingdang_totalmoney, "￥" + listBean.getOrder_amount());
        ObjectUtils.photo(mContext, listBean.getGoods_thumb(), (ImageView) holder.getView(R.id.item_list_mine_dingdang_img));
        holder.setVisible(R.id.item_list_mine_dingdang_refound_ll, true);

        holder.addOnClickListener(R.id.item_list_mine_dingdang_refound_apply);
        holder.addOnClickListener(R.id.item_list_mine_dingdang_refound_contact);
        holder.addOnClickListener(R.id.item_list_mine_dingdang_refound_detail);
        if (listBean.getStatus() == 10 && listBean.getStatus_shipping() == 0 && listBean.getType() == 2) {
            holder.setVisible(R.id.item_list_mine_dingdang_refound_apply, true);
            holder.setText(R.id.item_list_mine_dingdang_refound_apply, "退货");


        } else if (listBean.getStatus() == 10 && listBean.getStatus_shipping() == 1 && listBean.getType() == 2) {

            holder.setVisible(R.id.item_list_mine_dingdang_refound_apply, true);
            holder.setText(R.id.item_list_mine_dingdang_refound_apply, "退货信息");

        } else if (listBean.getStatus() == 2) {
            holder.setVisible(R.id.item_list_mine_dingdang_refound_apply, true);
            holder.setText(R.id.item_list_mine_dingdang_refound_apply, "再次申请");

        } else {
            holder.setVisible(R.id.item_list_mine_dingdang_refound_apply, false);
        }



    }


}


